package com.onpositive.mediawiki.propertyparser;

import com.onpositive.semantic.model.api.meta.IMeta;
import com.onpositive.units.AbstractPreprocessor;
import com.onpositive.units.AbstractValueParser;
import com.onpositive.units.ParsedString;
import com.onpositive.units.ParsedValue;

public class StringValueParser extends AbstractValueParser {
	
	public StringValueParser(){
		super.id = ParsedString.ID ;
	}

	@Override
	public ParsedValue parse(String s, IMeta meta, String comment) {
		String value = CompositeValueParser.killWikiRefsLeaveCaptions(s) ;
		value = value.replaceAll( "\\[|\\]|\\(|\\)|\\\"|\\'", "" ) ;
		return new ParsedString(value, getDefaultComment(comment));
	}

	@Override
	public AbstractPreprocessor getPreprocessor() {
		return null;
	}

}
